package com.iplant.basic.service.po.bpm;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.base.utils.annotation.join.multi.DBJoinMulti;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.basic.service.basicenum.bpm.BPMEventModule;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 流程业务基础表
 *
 * @author ShrisJava
 */
@DBBasePO(TableName = "bpm_taskbase", CheckName = {"Code"},
        Code = false, CodeAuto = true, CodePrefix = "BPMTaskBase")
public class BPMTaskBase extends BasePO implements Serializable {
    /**
     * 序列号
     */
    private static final long serialVersionUID = 1L;

    public BPMTaskBase() {
        super();
    }

    /**
     * 流程枚举 必须使用
     */
    @DBField
    public int FlowType = BPMEventModule.Default.getValue();

    /**
     * 流程实例ID
     */
    @DBField
    public int FlowID = 0;

    /**
     * 发起人
     */
    @DBCondition
    @DBField
    public int UpFlowID = 0;

    /**
     * 处理人ID
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.findInSet)
    @DBField
    public List<Integer> FollowerID = new ArrayList<Integer>();

    /**
     * 发起人名称 不存
     */
    @DBJoin(name = "Name", tableName = "mbs_user", tableAsName = "mbs_UpFlowName1", Schemas = DBSchemas.Basic,
            MainTableField = "UpFlowID")
    public String UpFlowName = "";

    /**
     * 处理人名称 不存
     */
    @DBJoinMulti(Name = "Name", MainTableField = "FollowerID", TableName = "mbs_user", Schemas = DBSchemas.Basic
    )
    public String FollowerName = "";

    /**
     * 任务状态
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.in)
    @DBField
    public int Status = 0;

    /**
     * 无枚举，根据流程定义确定状态名称
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String StatusText = "";

    /**
     * 流程代办任务ID 不存
     */
    public int StepID = 0;

    public int TagTypes = 0;

    @JsonProperty("FlowType")
    public int getFlowType() {
        return FlowType;
    }

    public void setFlowType(int flowType) {
        FlowType = flowType;
    }

    @JsonProperty("FlowID")
    public int getFlowID() {
        return FlowID;
    }

    public void setFlowID(int flowID) {
        FlowID = flowID;
    }

    @JsonProperty("UpFlowID")
    public int getUpFlowID() {
        return UpFlowID;
    }

    public void setUpFlowID(int upFlowID) {
        UpFlowID = upFlowID;
    }

    @JsonProperty("FollowerID")
    public List<Integer> getFollowerID() {
        return FollowerID;
    }

    public void setFollowerID(List<Integer> followerID) {
        FollowerID = followerID;
    }

    @JsonProperty("UpFlowName")
    public String getUpFlowName() {
        return UpFlowName;
    }

    public void setUpFlowName(String upFlowName) {
        UpFlowName = upFlowName;
    }

    @JsonProperty("FollowerName")
    public String getFollowerName() {
        return FollowerName;
    }

    public void setFollowerName(String followerName) {
        FollowerName = followerName;
    }



    @JsonProperty("StatusText")
    public String getStatusText() {
        return StatusText;
    }

    public void setStatusText(String statusText) {
        StatusText = statusText;
    }

    @JsonProperty("StepID")
    public int getStepID() {
        return StepID;
    }

    public void setStepID(int stepID) {
        StepID = stepID;
    }

    @JsonProperty("TagTypes")
    public int getTagTypes() {
        return TagTypes;
    }

    public void setTagTypes(int tagTypes) {
        TagTypes = tagTypes;
    }
}
